[bits 16]
		; switch to 32 bit protected mode
switch_to_pm:

cli				; disable interrupts
lgdt	[gdt_descriptor]	; load gdt

mov	eax,	cr0		; set the 32 bit flag in control register 0
or	eax,	0x1
mov	cr0,	eax

jmp	CODE_SEG:init_pm	; perform a far jump to force-flush the cpu pipeline


[bits 32]
		; initialize the registers and stack once in protected mode
init_pm:

mov	ax,	DATA_SEG
mov	ds,	ax
mov	es,	ax
mov	fs,	ax
mov	gs,	ax
mov	ss,	ax

mov	ebp,	0x90000
mov	esp,	ebp

call BEGIN_PM
